#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVBoxLayout>
#include "playlist.h"
#include "listbutton.h"
#include "lyric.h"
#include "albumcover.h"
#include "myslider.h"

namespace Ui {
    class MainWindow;
}

extern "C" {
#include "sandcat.h"
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    unsigned int total_list;
    unsigned int cur_list;
    unsigned int cur_entry;
    unsigned int timer_of_timer;
    QList<Playlist *> playlists;
    QVBoxLayout *listButtonLayout;
    QList<ListButton *> listButtons;
    Lyric *lyric;
    AlbumCover *cover;
    MySlider *position;
    MySlider *volume;
    void read_key_value();
    void refresh();

signals:
    void refreshSignal();

private slots:

    void on_prev_released();

    void on_play_released();

    void on_stop_released();

    void on_next_released();

    void on_mute_clicked(bool checked);

    void on_addList_released();

public slots:

    void timer_timeout();   /*自己写的槽不要以 on_ 开头*/

    void shut_down();

    void change_list( unsigned int listNum);

    void delete_list( unsigned int listNum );

    void playback(QModelIndex index);

protected:

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
